<admintpl file="header" />
</head>
<body>
	<div class="wrap js-check-wrap">
		<ul class="nav nav-tabs">
			<li class="active"><a href="{:U('user/index')}">{:L('ADMIN_USER_INDEX')}</a></li>
			<li><a href="{:U('user/add')}">{:L('ADMIN_USER_ADD')}</a></li>
		</ul>
        <form class="well form-search" method="post" action="{:U('User/index')}">
            用户名:
            <input type="text" name="user_login" style="width: 100px;" value="{:I('request.user_login/s','')}" placeholder="请输入{:L('USERNAME')}">
            <select name="model">
				<option value="">&nbsp;&nbsp;选择角色&nbsp;&nbsp;</option>
	            <foreach name="roles" item="vo">
					<if condition="$vo['id'] != 1 && $vo['id'] != 5">
						<option value="{$vo.id}" <if condition="I('request.model/s','') == $vo['id']">selected="selected"</if>>&nbsp;&nbsp;{$vo.name}&nbsp;&nbsp;</option>
					</if>
				</foreach>
            </select>
            <!--邮箱:-->
            <!--<input type="text" name="user_email" style="width: 100px;" value="{:I('request.user_email/s','')}" placeholder="请输入{:L('EMAIL')}">-->
            <input type="submit" class="btn btn-primary" value="搜索" />
            <a class="btn btn-danger" href="{:U('User/index')}">清空</a>
        </form>
		<table class="table table-hover table-bordered">
			<thead>
				<tr>
					<th width="50">ID</th>
					<th>{:L('USERNAME')}</th>
					<th>姓名</th>
					<th>电话</th>
					<th>类型</th>
					<th>所属机构</th>
					<th>{:L('LAST_LOGIN_IP')}</th>
					<th>{:L('LAST_LOGIN_TIME')}</th>
					<th>{:L('STATUS')}</th>
					<th width="120">{:L('ACTIONS')}</th>
				</tr>
			</thead>
			<tbody>
				<php>$user_statuses=array("0"=>L('USER_STATUS_BLOCKED'),"1"=>L('USER_STATUS_ACTIVATED'),"2"=>L('USER_STATUS_UNVERIFIED'));</php>
				<foreach name="users" item="vo">

				<if condition="$vo['delete_time']">
				<tr class="deleted">
				<else />
				<tr>
				</if>
					<td>{$vo.id}</td>
					<td><if condition="$vo['user_url']"><a href="{$vo.user_url}" target="_blank" title="{$vo.signature}">{$vo.user_login}</a><else />{$vo.user_login}</if></td>
					<td>
						{$vo.user_nicename}
					</td>
					<td>
						{$vo.user_phone}
					</td>
					<td>
						<foreach name="roles" item="role">
						<if  condition="$vo['model'] == $role['id']">
							{$role['name']}
						</if>
						</foreach>
					</td>
					<td>
						{$vo['organize_name']}
					</td>
					<td>{$vo.last_login_ip}</td>
					<td>
						<if condition="$vo['last_login_time'] eq 0">
							{:L('USER_HAVENOT_LOGIN')}
						<else />
							{$vo.last_login_time}
						</if>
					</td>
					<td>
						<if condition="$vo['delete_time']">
							已删除
						<else />
							{$user_statuses[$vo['user_status']]}
						</if>
					</td>
					<td class="undeleted">
						<if condition="$vo['delete_time']">
							<a href='{:U("user/overdelete",array("id"=>$vo["id"]))}'>彻底删除</a> |
							<a href='{:U("user/restore",array("id"=>$vo["id"]))}'>恢复数据</a>
						<else />
							<if condition="$vo['id'] eq 1 || $vo['id'] eq sp_get_current_admin_id()">
								<font color="#cccccc">{:L('EDIT')}</font> | <font color="#cccccc">{:L('DELETE')}</font> |
								<if condition="$vo['user_status'] eq 1">
									<font color="#cccccc">{:L('BLOCK_USER')}</font>
								<else />
									<font color="#cccccc">{:L('ACTIVATE_USER')}</font>
								</if>
							<else />
								<a href='{:U("user/edit",array("id"=>$vo["id"]))}'>{:L('EDIT')}</a> |
								<if condition="$vo['user_status'] eq 1">
									<a href="{:U('user/ban',array('id'=>$vo['id']))}" class="js-ajax-dialog-btn" data-msg="{:L('BLOCK_USER_CONFIRM_MESSAGE')}">{:L('BLOCK_USER')}</a> | 
								<else />
									<a href="{:U('user/cancelban',array('id'=>$vo['id']))}" class="js-ajax-dialog-btn" data-msg="{:L('ACTIVATE_USER_CONFIRM_MESSAGE')}">{:L('ACTIVATE_USER')}</a> | 
								</if>
								<a class="js-ajax-delete" href="{:U('user/delete',array('id'=>$vo['id']))}">{:L('DELETE')}</a>
							</if>
						</if>
					</td>
				</tr>
				</foreach>
			</tbody>
		</table>
		<div class="pagination">{$page}</div>
	</div>
	<script src="__PUBLIC__/js/common.js"></script>
</body>
</html>